require 'bumbrella/exceptions'

module Bumbrella
  module Util
    # Raised to indicate that the home directory of the current user
    # could not be ascertained.
    class NoUserHomeError < EnvironmentError
    end

    def Util.user_home()
      homedir = ENV['HOME']

      if not homedir then
        raise NoUserHomeError.new("cannot determine user home directory - ENV['HOME'] -> nil")
      end

      homedir
    end
  end
end
